import service from "../utils/requestTwo";


//  个人中心推荐物品列表    /xhr/bonus/rcmd.json 

export interface cartInfoList {
  id: number,
  userId: string,
  skuId: number,
  cartPrice: number,
  skuNum: number,
  imgUrl: string,
  skuName: string,
  isChecked: number,
  createTime: string,
  operateTime: string,
  isOrdered: number,
  orderTime: string,
  sourceType: string,
  sourceId: number,
  skuPrice: number,
  couponInfoList: null
}

export interface CatList {

  activityRuleList: null,
  cartInfoList: cartInfoList[],
  createTime: string,
}

export default {
  GetCartList() {
    return service.get<any, any>('/cart/cartList')
  },
  PostAddToCart(skuId: number, skuNum: number) {
    return service.post<any, null>(`/cart/addToCart/${skuId}/${skuNum}`)
  },

  DeleteisChecked(skuId: number) {
    return service.delete<any, any>(`/cart/deleteCart/${skuId}`)
  },
  GETisChecked(skuId: number, isChecked: number) {
    return service.get<any, any>(`/cart/checkCart/${skuId}/${isChecked}`)
  },
  PostBatchCheckCart(isChecked: number, cardIdList: number[]) {
    return service.post(`/cart/batchCheckCart/${isChecked}`, cardIdList)
  }

}
